function [ files ] = getpictureset( path, name )
%GETPICTURESET retrives valid file names first arg is the folder relative
%path, and the second is the base name without the index.
%   first arg is the directory  second isthe name of the file set
i = 1;
file = ['./', path, '/', name,num2str(i),'.pgm'];
while exist(file, 'file')
    files(1,i) = cellstr(file);
    i=i+1;
    file = ['./', path, '/', name,num2str(i),'.pgm'];
end

end

